package com.zx.sealeds;

/**
 * <p>
 * description:  <br>
 * create: 2025-05-16 15:03
 * </p>
 *
 * @author zhou  xun
 */
// ======================
// 3. non-sealed 子类：重新开放继承
// ======================
public non-sealed class Triangle extends Shape {
    private final double base, height;

    public Triangle(double base, double height) {
        this.base = base;
        this.height = height;
    }

    @Override
    public double area() {
        return 0.5 * base * height;
    }
}

